widget: Remove state-flags leftovers
authorTimm Bäder <mail@baedert.org>
Tue, 1 Nov 2016 19:28:28 +0000 (20:28 +0100)
committerTimm Bäder <mail@baedert.org>
Wed, 2 Nov 2016 17:40:00 +0000 (18:40 +0100)
gtk/gtkbutton.c
gtk/gtkcellrendererspinner.c
gtk/gtkenums.h
gtk/gtkpathbar.c
gtk/gtkwidget.h

index 048b2c15e8870b6a19dc768dc52381886fb73f6e..6e3734ed85f789a36a4ede68abae80c604ad0e51 100644 (file)
@@ -140,8 +140,8 @@ static void gtk_button_update_state   (GtkButton          *button);
 static void gtk_button_finish_activate (GtkButton         *button,
                                        gboolean           do_it);
 
-static void gtk_button_state_changed   (GtkWidget             *widget,
-                                       GtkStateType           previous_state);
+static void gtk_button_state_flags_changed (GtkWidget     *widget,
+                                            GtkStateFlags  previous_state);
 static void gtk_button_grab_notify     (GtkWidget             *widget,
                                        gboolean               was_grabbed);
 static void gtk_button_do_release      (GtkButton             *button,
@@ -229,7 +229,7 @@ gtk_button_class_init (GtkButtonClass *klass)
   widget_class->key_release_event = gtk_button_key_release;
   widget_class->enter_notify_event = gtk_button_enter_notify;
   widget_class->leave_notify_event = gtk_button_leave_notify;
-  widget_class->state_changed = gtk_button_state_changed;
+  widget_class->state_flags_changed = gtk_button_state_flags_changed;
   widget_class->grab_notify = gtk_button_grab_notify;
 
   container_class->add    = gtk_button_add;
@@ -1290,8 +1290,8 @@ gtk_button_screen_changed (GtkWidget *widget,
 }
 
 static void
-gtk_button_state_changed (GtkWidget    *widget,
-                          GtkStateType  previous_state)
+gtk_button_state_flags_changed (GtkWidget     *widget,
+                                GtkStateFlags  previous_state)
 {
   GtkButton *button = GTK_BUTTON (widget);
 
index dc7a0d19c76f4ff191ffdb93dd8aa9c667050dc9..3e86a4f63fbf739ae4d03a97005c8adf1c303921 100644 (file)
@@ -326,9 +326,6 @@ gtk_cell_renderer_spinner_get_size (GtkCellRenderer    *cellr,
 static void
 gtk_paint_spinner (GtkStyleContext *context,
                    cairo_t         *cr,
-                   GtkStateType     state_type,
-                   GtkWidget       *widget,
-                   const gchar     *detail,
                    guint            step,
                    gint             x,
                    gint             y,
@@ -400,7 +397,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer      *cellr,
 {
   GtkCellRendererSpinner *cell = GTK_CELL_RENDERER_SPINNER (cellr);
   GtkCellRendererSpinnerPrivate *priv = cell->priv;
-  GtkStateType state;
   GdkRectangle pix_rect;
   GdkRectangle draw_rect;
   gint xpad, ypad;
@@ -424,25 +420,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer      *cellr,
   if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect))
     return;
 
-  state = GTK_STATE_NORMAL;
-  if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE) ||
-      !gtk_cell_renderer_get_sensitive (cellr))
-    {
-      state = GTK_STATE_INSENSITIVE;
-    }
-  else
-    {
-      if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
-        {
-          if (gtk_widget_has_focus (widget))
-            state = GTK_STATE_SELECTED;
-          else
-            state = GTK_STATE_ACTIVE;
-        }
-      else
-        state = GTK_STATE_PRELIGHT;
-    }
-
   cairo_save (cr);
 
   gdk_cairo_rectangle (cr, cell_area);
@@ -450,9 +427,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer      *cellr,
 
   gtk_paint_spinner (gtk_widget_get_style_context (widget),
                      cr,
-                     state,
-                     widget,
-                     "cell",
                      priv->pulse,
                      draw_rect.x, draw_rect.y,
                      draw_rect.width, draw_rect.height);
index b4ef057b758bf42481b86e6f3a6120a7f2245c4f..65ef2c516b24cc9c21e36db14ffcb76ba11638fd 100644 (file)
@@ -481,39 +481,6 @@ typedef enum
 
 /* Widget states */
 
-/**
- * GtkStateType:
- * @GTK_STATE_NORMAL: State during normal operation.
- * @GTK_STATE_ACTIVE: State of a currently active widget, such as a depressed button.
- * @GTK_STATE_PRELIGHT: State indicating that the mouse pointer is over
- *                      the widget and the widget will respond to mouse clicks.
- * @GTK_STATE_SELECTED: State of a selected item, such the selected row in a list.
- * @GTK_STATE_INSENSITIVE: State indicating that the widget is
- *                         unresponsive to user actions.
- * @GTK_STATE_INCONSISTENT: The widget is inconsistent, such as checkbuttons
- *                          or radiobuttons that aren’t either set to %TRUE nor %FALSE,
- *                          or buttons requiring the user attention.
- * @GTK_STATE_FOCUSED: The widget has the keyboard focus.
- *
- * This type indicates the current state of a widget; the state determines how
- * the widget is drawn. The #GtkStateType enumeration is also used to
- * identify different colors in a #GtkStyle for drawing, so states can be
- * used for subparts of a widget as well as entire widgets.
- *
- * Deprecated: 3.14: All APIs that are using this enumeration have been deprecated
- *     in favor of alternatives using #GtkStateFlags.
- */
-typedef enum
-{
-  GTK_STATE_NORMAL,
-  GTK_STATE_ACTIVE,
-  GTK_STATE_PRELIGHT,
-  GTK_STATE_SELECTED,
-  GTK_STATE_INSENSITIVE,
-  GTK_STATE_INCONSISTENT,
-  GTK_STATE_FOCUSED
-} GtkStateType;
-
 /**
  * GtkToolbarStyle:
  * @GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.
index 76dddbcf7d852c893cf578b47c9d5348590ffa7e..fdb422351e15165d97d1fbd726bec2d0586ade76 100644 (file)
@@ -155,8 +155,8 @@ static gboolean gtk_path_bar_slider_button_release(GtkWidget        *widget,
                                                   GtkPathBar       *path_bar);
 static void gtk_path_bar_grab_notify              (GtkWidget        *widget,
                                                   gboolean          was_grabbed);
-static void gtk_path_bar_state_changed            (GtkWidget        *widget,
-                                                  GtkStateType      previous_state);
+static void gtk_path_bar_state_flags_changed      (GtkWidget        *widget,
+                                                   GtkStateFlags     previous_state);
 static void gtk_path_bar_style_updated            (GtkWidget        *widget);
 static void gtk_path_bar_screen_changed           (GtkWidget        *widget,
                                                   GdkScreen        *previous_screen);
@@ -231,7 +231,7 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
   widget_class->style_updated = gtk_path_bar_style_updated;
   widget_class->screen_changed = gtk_path_bar_screen_changed;
   widget_class->grab_notify = gtk_path_bar_grab_notify;
-  widget_class->state_changed = gtk_path_bar_state_changed;
+  widget_class->state_flags_changed = gtk_path_bar_state_flags_changed;
   widget_class->scroll_event = gtk_path_bar_scroll;
 
   container_class->add = gtk_path_bar_add;
@@ -1099,8 +1099,8 @@ gtk_path_bar_grab_notify (GtkWidget *widget,
 }
 
 static void
-gtk_path_bar_state_changed (GtkWidget    *widget,
-                           GtkStateType  previous_state)
+gtk_path_bar_state_flags_changed (GtkWidget     *widget,
+                                  GtkStateFlags  previous_state)
 {
   if (!gtk_widget_is_sensitive (widget))
     gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
index 068323393898c8fdc005e8f8c69e93e71433ae80..ba52529bc5b5a09177f8fc0f23834aa1d5769146 100644 (file)
@@ -342,8 +342,6 @@ struct _GtkWidgetClass
   void (* unrealize)          (GtkWidget        *widget);
   void (* size_allocate)       (GtkWidget        *widget,
                                GtkAllocation    *allocation);
-  void (* state_changed)       (GtkWidget        *widget,
-                               GtkStateType      previous_state);
   void (* state_flags_changed) (GtkWidget        *widget,
                                GtkStateFlags     previous_state_flags);
   void (* parent_set)         (GtkWidget        *widget,